<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center home_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub home_fd0_0'>
					<view class="flex align-center left_sadaq">
						<view class='flex flex-wrap align-center home_fd0_0_c0' @click="choseLocation">
							<text class='home_fd0_0_c0_c0'>{{location}}</text>
							<image class='home_fd0_0_c0_c1' mode="aspectFit" :src='STATIC_URL+"19.png"'></image>
						</view>
						<view class='flex flex-wrap align-center' style="margin-left: 24rpx;" @tap.stop="handleJumpDiy"
							data-type="navigateTo" :data-url="`/pages/ss/search/search`">
							<image class='home_fd0_0_c1_c0' style="width: 24rpx;height: 24rpx;margin-right: 16rpx;"
								mode="aspectFit" :src='STATIC_URL+"16.png"'></image>
							<input style="width: 200rpx;" type="text" :placeholder="`请输入搜索内容`" confirm-type="done"
								:maxlength="-1" placeholder-style="color:rgba(153, 153, 153, 1);font-size:24rpx" />
						</view>
					</view>
					<view style="margin-left: 32rpx;">
						<image @tap.stop="handleJumpDiy" data-type="navigateTo"
							:data-url="`/pages/grzx/shareApp/shareApp`" class='home_fd0_0_c1_c0' mode="aspectFit"
							style="margin-right: 32rpx;" :src='STATIC_URL+"239.png"'></image>
						<image class='home_fd0_0_c1_c0' mode="aspectFit" :src='STATIC_URL+"240.png"' @tap.stop="handleJumpDiy"
							data-type="navigateTo" :data-url="`/pages/mine/findRoommap/findRoommap`"></image>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<benben-popup v-model="popupShow1695778435826" :mask="true" :mask-close-able="false" mode='center'
				:z-index='999'>
				<!---flex布局flex布局开始-->
				<view class="flex benben-flex-layout flex-wrap align-center">
					<view class='flex flex-direction flex-wrap align-center home_fd1_0'>
						<text class='home_fd1_0_c0'>提示</text>
						<text class='home_fd1_0_c1'>您还未登录，请先去登录~</text>
					</view>
				</view>

				<!---flex布局flex布局结束-->

			</benben-popup>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout home_flex_2">
				<view style="position: relative">
					<swiper ref="benbenSwiperfd2_0" @change="bannerIndexfd2_0 = $event.detail.current"
						class='flex position-relative home_fd2_0' previous-margin="0rpx" next-margin="0rpx"
						:display-multiple-items="1" :interval="5000" :duration="500" :autoplay='true' :circular='true'>
						<swiper-item class='flex home_fd2_0' v-for="(item,index) in bannerList">
							<image class='home_fd2_0_c1_c0' mode="aspectFit" :src='item.fengmian' @tap.stop="handleJumpDiy"
							data-type="navigateTo" :data-url="`/pages/grzx/bannerDetails/bannerDetails?aid=${item.aid}`"></image>
						</swiper-item>
					</swiper>
					<view style="position: absolute"
						class="flex dot flex align-center justify-center home_swiperDotfd2_0">
						<template v-for="(item, index) in (1)">
							<view :key="index" v-if="bannerIndexfd2_0 == index"
								class="flex dot selected flex align-center justify-center home_swiperDotSelectedfd2_0">
							</view>
							<view :key="index" v-else
								class="flex dot unselected flex align-center justify-center home_swiperDotUnselectedfd2_0">
							</view>
						</template>
					</view>
				</view>
				<view style="position: relative" v-if="tabAreaData.length > 0">
					<swiper ref="benbenSwiperfd2_1" @change="bannerIndexfd2_1 = $event.detail.current"
						class='flex position-relative home_fd2_1' previous-margin="0rpx" next-margin="0rpx"
						:display-multiple-items="1" :interval="5000" :duration="500" :autoplay='true' :circular='true'>


						<swiper-item class='flex  home_fd2_1_c1'>
							<view class='flex flex-direction flex-wrap align-stretch home_fd2_1_c1_c0'>
								<view class='flex flex-wrap align-center'>
									<view v-for="(item,index) in tabAreaData" :key="index"
										class='flex flex-direction flex-wrap align-center home_fd2_1_c1_c0_c0_c0'
										@tap.stop="handleclickJumpDiy(item)">
										<image class='home_fd2_1_c1_c0_c0_c0_c0' mode="aspectFit" :src='item.fengmian'>
										</image>
										<text class='home_fd2_1_c1_c0_c0_c0_c1'>{{item.mingcheng}}</text>
									</view>
								</view>
							</view>
						</swiper-item>
					</swiper>
					<view style="position: absolute"
						class="flex dot flex align-center justify-center  home_swiperDotfd2_0">
						<template v-for="(item, index) in (1)">
							<view :key="index" v-if="bannerIndexfd2_1 == index"
								class="flex dot selected flex align-center justify-center home_swiperDotSelectedfd2_1">
							</view>
							<view :key="index" v-else
								class="flex dot unselected flex align-center justify-center home_swiperDotUnselectedfd2_1">
							</view>
						</template>
					</view>
				</view>
				<view class='flex flex-wrap align-center justify-center home_fd2_2'>
					<image class='home_fd2_2_c0' mode="aspectFit" :src='STATIC_URL+"54.png"'></image>
					<text class='home_fd2_2_c1'>公示栏</text>
					<image class='home_fd2_2_c0' mode="aspectFit" :src='STATIC_URL+"55.png"'></image>
				</view>
				<view class='flex flex-wrap align-start justify-end home_fd2_3' v-for="(item,index) in ziXunList"
					:key="index">
					<view class='flex flex-direction flex-wrap align-stretch flex-sub' @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/pages/mine/newsDetail/newsDetail?aid=${item.aid}`">
						<text class='home_fd2_3_c0_c0'>{{item.biaoti}}</text>
						<text class='home_fd2_3_c0_c1'>{{item.create_time}}</text>
					</view>
					<image class='home_fd2_3_c1' mode="aspectFill"
						:src='item.fengmian?item.fengmian:STATIC_URL+"18.png"'>
					</image>
				</view>
				<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout rentHouse_flex_3">
					<view class='flex flex-wrap align-start rentHouse_fd3_0' @tap.stop="handleJumpDiy"
						data-type="navigateTo"
						:data-url="`/pages/mine/rentalPropertydetails/rentalPropertydetails?district_id=${item.district_id}&id=${item.id}`"
						v-for="(item,index) in houseArr" :key="index">
						<image class='rentHouse_fd3_0_c0' mode="aspectFill" :src='item.cover'></image>
						<view class='flex flex-direction flex-wrap align-start flex-sub'>
							<view class='flex flex-wrap align-center'>
								<text class='rentHouse_fd3_0_c1_c0_c0'>{{item.title}}</text>
							</view>
							<view class='flex flex-wrap align-center rentHouse_fd3_0_c1_c1'>
								<text class='rentHouse_fd3_0_c1_c1_c0'>{{item.city}}</text>
								<text class='rentHouse_fd3_0_c1_c1_c0'>丨</text>
								<text class='rentHouse_fd3_0_c1_c1_c0'>{{item.build_roow}}</text>
								<text class='rentHouse_fd3_0_c1_c1_c0'>丨</text>
								<text class='rentHouse_fd3_0_c1_c1_c0'>{{item.area}}</text>
								<text class='rentHouse_fd3_0_c1_c1_c0'>㎡</text>
							</view>
							<view class='flex flex-wrap align-center rentHouse_fd3_0_c1_c2'>
								<text class='rentHouse_fd3_0_c1_c2_c0'>{{item.price}}</text>
								<text class='rentHouse_fd3_0_c1_c2_c1'>元/月</text>
							</view>
						</view>
					</view>
				</view>
			</view>
			<!---flex布局flex布局结束-->
		</view>
	</view>
</template>
<script>
	export default {
		components: {},
		data() {
			return {
				"bannerIndexfd2_0": 0,
				"bannerIndexfd2_1": 0,
				"popupShow1695778435826": false,
				location: '杭州市',
				userLat: "",
				userLng: "",
				tabAreaData: [],
				ziXunList: [],
				houseArr: [],
				bannerList:[],
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},
		},
		watch: {},
		onLoad(options) {
			if (global.appTabBarType) this.toHomeDiy()
			this.changeLocal()
			// uni.getLocation({
			// 	type: 'gcj02',
			// 	geocode: true,
			// 	success: function(res) {
			// 		console.log("定位===", res)
			// 	}
			// });
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			var that = this
			// uni.getStorage({
			// 	key: 'Visit_key',
			// 	success: function(res) {
			// 		console.log(res.data[0].cityName);
			// 		if (res.data.length != 0) {
			// 			that.location = res.data[0].cityName
			// 		}
			// 	}
			// });
			that.get_banner()
			uni.$on('back_city', res => {
				console.log("选择的城市===", res);
				this.location = res;
			})
			uni.$on('back_lat', res => {
				console.log("选择的城市===", res);
				this.location = res.position
				this.userLat = res.latitude
				this.userLng = res.longitude
			})
			that.homeIndex()
			that.getZiXun()
			// that.getVal()
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			get_banner(){
				this.$api.post('/m6752/66696f007b5ae').then(res=>{
					if(res.data.code == 1){
						this.bannerList = res.data.data
					}
				})
			},
			handleclickJumpDiy(item) {
				if(item.mingcheng == '公共建筑'){
					let url = '/pages/mine/publicBuildings/publicBuildings' + '?mingcheng=' + item.mingcheng + '&housecate_id=' + item.aid
					uni.navigateTo({
						url: url
					})
				}else{
					let url = item.jump_url + '?mingcheng=' + item.mingcheng + '&housecate_id=' + item.aid
					uni.navigateTo({
						url: url
					})
				}
			},
			changeLocal() {
				// uni.showLoading({
				// 	title:'定位中'
				// })
				var that = this
				uni.getLocation({
					type: 'gcj02',
					geocode: 'true',
					success: function(res) {
						// uni.hideLoading()
						console.log(res, '位置>>>>>>>>>>>>>>>>>')
						that.location = res.address.city
						uni.setStorageSync('location', that.location)
						console.log('当前位置的经度：' + res.longitude);
						console.log('当前位置的纬度：' + res.latitude);
						let addressStreet = res.address.province + res.address.city + res
							.address.district + res.address.street
						uni.setStorageSync('addressStreet', addressStreet)
						let addressDistrict = res.address.province + res.address.city + res
							.address.district
						uni.setStorageSync('addressDistrict', addressDistrict)
						// that.infoData.address = address
						// if (address) {
						// 	uni.request({
						// 		url: 'https://restapi.amap.com/v3/geocode/geo',
						// 		data: {
						// 			key: "6d4e8132e768de873dbc42a6dd9787f2",
						// 			address: address
						// 		},
						// 		success: (resout) => {
						// 			console.log(resout)
						// 			// console.log(resout.data.geocodes[0].adcode);
						// 			let data = {
						// 				lng: res.longitude, // 经度
						// 				lat: res.latitude, // 纬度
						// 				address: address, // 详细地址
						// 				// adcode: resout.data.geocodes[0].adcode
						// 			}
						// 		}
						// 	})
						// }
					},
					fail(e) {
						uni.hideLoading()
					},
					complete(e) {
						uni.hideLoading()
					}
				});
			},
			getVal() {
				this.$api.post('/m6752/6551cd87582d8', {
					roow_id: '1'
				}).then(res => {
					if (res.data.code == 1) {
						this.houseArr = res.data.data.data
					} else {
						this.$message.info(res.data.msg)
					}
				})
			},
			getZiXun() {
				this.$api.post('/m6752/66697042c5e38', {}).then(res => {
					if (res.data.code == 1) {
						this.ziXunList = res.data.data
					}
				})
			},
			// 首页金刚区
			homeIndex() {
				this.$api.post('/m6752/66696fb39311e', {}).then(res => {
					if (res.data.code == 1) {
						this.tabAreaData = res.data.data
					} else {
						this.$message.info(res.data.msg)
					}
				})
			},
			//提示登录
			promptLoginFunc() {
				this.popupShow1695778435826 = true;
				setTimeout(() => {
					this.toLoginDiy();
				}, 800)
			},
			// 切换城市定位
			choseLocation() {
				uni.navigateTo({
					url: '/pages/mine/selectCity/selectCity'
				})
			},
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #fff;
		background-size: 100% auto;
	}

	.left_sadaq {
		width: calc(100% - 145rpx);
		height: 60rpx;
		border-radius: 30rpx;
		background: rgba(246, 247, 249, 1);
		padding: 0 32rpx;
	}

	.home_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.home_fd0_0_c2_c0 {
		width: 44rpx;
		height: 44rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.home_fd0_0_c2 {
		width: 50rpx;
	}

	.home_fd0_0_c1_c0 {
		width: 40rpx;
		height: 40rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.home_fd0_0_c1 {
		border: 2px solid #333333;
		background: rgba(255, 255, 255, 0.62);
		border-radius: 40rpx 40rpx 40rpx 40rpx;
		width: 532rpx;
		height: 64rpx;
		padding: 0rpx 0rpx 0rpx 24rpx;
	}

	.home_fd0_0_c0_c1 {
		width: 14rpx;
		height: 14rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.home_fd0_0_c0_c0 {
		color: #333333;
		font-size: 30rpx;
		font-weight: 500;
		line-height: 30rpx;
		margin: 0rpx 8rpx 0rpx 0rpx;
	}

	.home_fd0_0_c0 {
		width: 120rpx;
	}

	.home_fd0_0 {
		padding: 0rpx 24rpx 0rpx 24rpx;
	}

	.home_fd1_0_c1 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 400;
		line-height: 44rpx;
	}

	.home_fd1_0_c0 {
		color: #333333;
		font-size: 36rpx;
		font-weight: 500;
		line-height: 44rpx;
		margin: 0rpx 0rpx 40rpx 0rpx;
	}

	.home_fd1_0 {
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		width: 540rpx;
		height: 231rpx;
		padding: 48rpx 0rpx 0rpx 0rpx;
	}

	.home_flex_2 {
		padding: 24rpx 24rpx 0rpx 24rpx;
	}

	.home_fd2_3_c1 {
		width: 216rpx;
		height: 162rpx;
		margin: 0rpx 0rpx 0rpx 22rpx;
		border-radius: 16rpx;
	}

	.home_fd2_3_c0_c1 {
		color: #999999;
		font-size: 24rpx;
		font-weight: 400;
		line-height: 24rpx;
		margin: 36rpx 0rpx 0rpx 0rpx;
	}

	.home_fd2_3_c0_c0 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 500;
		line-height: 48rpx;
		-webkit-line-clamp: 2;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		width: 416rpx;
	}

	.home_fd2_3 {
		background: var(--benbenbgColor1);
		margin: 0rpx 0rpx 24rpx 0rpx;
		padding: 32rpx 24rpx 32rpx 24rpx;
		border-radius: 16rpx;
		background-size: 100% auto;
	}

	.home_fd2_2_c1 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 600;
		line-height: 30rpx;
		margin: 0rpx 16rpx 0rpx 16rpx;
	}

	.home_fd2_2_c0 {
		width: 32rpx;
		height: 32rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.home_fd2_2 {
		margin: 32rpx 0rpx 24rpx 0rpx;
	}

	.home_fd2_1_c1 {
		background: var(--benbenbgColor1);
		width: 702rpx;
		height: 354rpx;
		border-radius: 16rpx;
		background-size: 100% auto;
	}

	.home_fd2_1_c1_c0_c1 {
		margin: 32rpx 0rpx 0rpx 0rpx;
	}

	.home_fd2_1_c1_c0_c0_c0_c1 {
		color: #333333;
		font-size: 24rpx;
		font-weight: 400;
	}

	.home_fd2_1_c1_c0_c0_c0_c0 {
		width: 72rpx;
		height: 72rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 0rpx 24rpx 0rpx;
	}

	.home_fd2_1_c1_c0_c0_c0 {
		width: 140rpx;
		margin-bottom: 24rpx;
	}

	.home_fd2_1_c1_c0 {
		background: var(--benbenbgColor1);
		padding: 32rpx 0rpx 32rpx 0rpx;
		border-radius: 16rpx;
		background-size: 100% auto;
	}

	.home_fd2_1 {
		background: var(--benbenbgColor1);
		width: 702rpx;
		height: 354rpx;
		margin: 24rpx 0rpx 0rpx 0rpx;
		border-radius: 16rpx;
		background-size: 100% auto;
	}

	.home_swiperDotUnselectedfd2_1 {
		background: rgba(51, 51, 51, 0.3);
		width: 8rpx;
		height: 8rpx;
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		margin: 0rpx 6rpx 0rpx 0rpx;
		font-size: 24rpx;
		color: #fff;
	}

	.home_swiperDotSelectedfd2_1 {
		background: #333333;
		width: 24rpx;
		height: 8rpx;
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		margin: 0rpx 6rpx 0rpx 0rpx;
		font-size: 24rpx;
		color: #fff;
	}

	.home_numberfd2_0_c0 {
		background: #525050;
		position: absolute;
		bottom: 20rpx;
		right: 30rpx;
		width: 80rpx;
		height: 40rpx;
		border-radius: 6rpx 6rpx 6rpx 6rpx;
		font-size: 24rpx;
		color: #FFFFFF;
		line-height: 46rpx;
		font-weight: 400;
	}

	.home_fd2_0_c1_c0 {
		width: 702rpx;
		height: 320rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.home_fd2_0 {
		width: 702rpx;
		height: 320rpx;
	}

	.home_swiperDotUnselectedfd2_0 {
		background: rgba(255, 255, 255, 0.3);
		width: 8rpx;
		height: 8rpx;
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		margin: 0rpx 6rpx 0rpx 0rpx;
		font-size: 24rpx;
		color: #fff;
	}

	.home_swiperDotSelectedfd2_0 {
		background: #FFFFFF;
		width: 24rpx;
		height: 8rpx;
		border-radius: 4rpx 4rpx 4rpx 4rpx;
		margin: 0rpx 6rpx 0rpx 0rpx;
		font-size: 24rpx;
		color: #fff;
	}

	::v-deep .home_swiperDotfd2_0 {
		position: absolute;
		bottom: 20rpx;
		left: 0rpx;
		right: 0rpx;
	}

	.rentHouse_flex_3 {
		margin-bottom: 40rpx
	}

	.rentHouse_fd3_0_c1_c3_c0 {
		background: rgba(253, 235, 235, 1);
		color: rgba(234, 64, 64, 1);
		font-size: 20rpx;
		font-weight: 400;
		line-height: 32rpx;
		padding: 1rpx 8rpx 1rpx 8rpx;
		background-size: 100% auto !important;
		margin: 0rpx 8rpx 0rpx 0rpx;
		border-radius: 6rpx;
	}

	.rentHouse_fd3_0_c1_c3 {
		margin: 8rpx 0rpx 0rpx 0rpx;
	}

	.rentHouse_fd3_0_c1_c2_c1 {
		color: rgba(234, 55, 39, 1);
		font-size: 24rpx;
		font-weight: 600;
		line-height: 30rpx;
	}

	.rentHouse_fd3_0_c1_c2_c0 {
		color: rgba(234, 55, 39, 1);
		font-size: 32rpx;
		font-weight: 600;
		line-height: 30rpx;
	}

	.rentHouse_fd3_0_c1_c2 {
		margin: 0rpx 0rpx 16rpx 0rpx;
	}

	.rentHouse_fd3_0_c1_c1_c0 {
		color: #666666;
		font-size: 22rpx;
		font-weight: 400;
		line-height: 22rpx;
	}

	.rentHouse_fd3_0_c1_c1 {
		margin: 16rpx 0rpx 16rpx 0rpx;
	}

	.rentHouse_fd3_0_c1_c0_c0 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 500;
		line-height: 32rpx;
	}

	.rentHouse_fd3_0_c0 {
		width: 216rpx;
		height: 192rpx;
		border-radius: 16rpx;
		margin: 0rpx 20rpx 0rpx 0rpx;
	}

	.rentHouse_fd3_0 {
		background: rgba(255, 255, 255, 1);
		background-size: 100% auto !important;
		padding: 32rpx 0rpx 32rpx 24rpx;
		margin: 24rpx 0rpx 0rpx 0rpx;
		border-radius: 16rpx;
	}
</style>